<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box1 {
            /*定义使用弹性盒模型布局*/
            /*float，clear，vertical-align会失效*/
            /*被此包括的子元素叫做项目*/
            /*默认是主轴水平排列，交叉轴是垂直排列*/
            display: flex;
            /*row:默认可以不写*/
            flex-direction: row;
            align-content: start;
            width: 300px;
            height: 300px;
            background-color: #999999;
        }

        .box1 div {
            width: 50px;
            height: 50px;
            background-color: pink;
            margin: 3px;
            border: 1px solid #000000;
            /*高宽包含内边距*/
            box-sizing: border-box;
        }

        .box1 .div1 {
            order: -2;
        }

        .box1 .div2 {
            order: -3;
        }

        .box1 .div3 {
            order: -1;
        }

        .box1 .div4 {
            order: -4;
        }


    </style>
</head>
<body>
<div class="box1">
    <div class="div1">1</div>
    <div class="div2">2</div>
    <div class="div3">3</div>
    <div class="div4">4</div>
</div>
</body>
</html>